#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct
{
    int ID;
    char *name;
}StuNode, *StuNodePt;

void CreateNode(StuNodePt pNode);
void DestroyNode(StuNodePt pNode);
void Output(StuNodePt pNode);

int main(void)
{
    StuNodePt pst;

    CreateNode(pst);
    Output(pst);
    DestroyNode(pst);
    pst = NULL;

    return 0;
}

void Output(StuNodePt pst)
{
    printf("ID = %d\nname = %s\n", pst->ID, pst->name);
}

void DestroyNode(StuNodePt pNode)
{
    free(pNode->name);
    free(pNode);
}

void CreateNode(StuNodePt pNode)
{

    pNode = (StuNodePt)malloc(sizeof(StuNode));
    pNode->ID = 101;
    pNode->name = (char*)malloc((strlen("Alise") + 1) * sizeof(char));
    strcpy(pNode->name, "Alise");
}
